import http from "@/config/request.ts";

// 检查文件是否存在
export function checkFileExist(data: any) {
  return http.sendRequest({
    url: "/file/checkMd5",
    data: data,
    type: "GET",
  });
}

// 上传文件
export function uploadFile(data: any) {
  return http.sendRequest({
    url: "/file/upload",
    data: data,
    type: "POST",
  });
}
// 获取七牛token
export function getQiniuConfig() {
  return http.sendRequest({
    url: "/file/getUpToken",
    type: "GET",
  });
}
// 保存md5和uri关系
export function saveMd5(data: any) {
  return http.sendRequest({
    url: "/file/saveMd5",
    data: data,
    type: "POST",
  });
}
